using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using Ltf.Remoting.Settings;
using Ltf.Remoting.RemoteEvents;
using System.Windows.Forms;

namespace Ltf.MonitorLizard.Forms
{
	public class FormTypeConstructor
	{
		private Type typeofForm;

		public FormTypeConstructor(Type typeofForm)
		{
			this.typeofForm = typeofForm;
		}

		public Form GetNewInstance(string[] pathList, LizardEventArgs args)
		{
			ConstructorInfo ci = typeofForm.GetConstructor(new Type[] { typeof(string[]), typeof(LizardEventArgs) });
			if (ci != null)
				return (Form)ci.Invoke(new object[] { pathList, args });
			else
				return null;
		}
	}
}
